<?php
	include("../include/init.php");//将配置文件全部加载进来
	include("../include/check_login.php");//登录

	$insert = new sql_class("user");
	$login_time = date("Y-m-d H:i:s");

	if($_POST){
		
		$data = array(
					"user_phone"=>trim($_POST['user_phone']),
					"user_pw"=>md5($_POST['user_pw']),
					"user_login"=>time(),
				);
		$insert_id = $insert->save($data);
		if($insert_id){
			show_msg("添加用户成功","user_list.php");
			exit;
		}else{
			show_msg("添加用户失败","user_add.php");
			exit;
		}
	}
	

	$smarty->assign("login_time",$login_time);
	$smarty->display("admin/user_add.html");//连接index.html



?>